
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link href="css/style.css" rel="stylesheet"/>
    <link href="css/base.css" rel="stylesheet"/>
    <script src="js/jquery1.42.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-3.3.1.min.js" charset="utf-8"></script>
    <script src="js/jquery.SuperSlide.2.1.3.js" type="text/javascript"></script>
    <script src="js/flexible.min.js" type="text/javascript"></script>
    <title>意见反馈</title>
</head>
<body style="background-color: rgb(242,242,242);">
<div class="opinion">
    <div class='output_title'>
        <input placeholder="输入标题" id="title"/>
        <p></p>
        <textarea placeholder="请详细的描述你的建议或者反馈意见" id ="content"></textarea>
    </div>
    <div class='phone'>
        <span>联系方式</span>
        <input placeholder="请输入手机号"  id="phone"/>
    </div>
    <div class="opinion_btn" onclick="advicefeedback()">提交意见</div>

    <script>
        function advicefeedback() {
            title = document.getElementById('title').value;
            content = document.getElementById('content').value;
            phone = document.getElementById('phone').value;
            $.ajax({
                url: '/mobile/advicefeedback',
                type: 'POST', //GET
                async: true,    //或false,是否异步
                dataType: 'json',    //返回的数据格式：json/xml/html/script/jsonp/text.
                data: {
                    'title': title,
                    'content':content,
                    'phone': phone
                },
                success: function (reData) {
                    if(""!=reData){

                        alert("提交成功");
                        window.location.href = 'grzx_opinion_success.html';
                    }else {

                        alert("提交失败");
                    }
                },

            });
        }
    </script>

</div>
</body>
</html>